FROM lsqtzj/openeuler_dotnet_sdk AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM lsqtzj/openeuler_dotnet_sdk AS build
WORKDIR /src
COPY ["Magic.Web.Entry/Magic.Web.Entry.csproj", "Magic.Web.Entry/"]
COPY ["Magic.Web.Core/Magic.Web.Core.csproj", "Magic.Web.Core/"]
COPY ["Magic.Application/Magic.Application.csproj", "Magic.Application/"]
COPY ["Magic.Core/Magic.Core.csproj", "Magic.Core/"]
COPY ["Magic.FlowCenter/Magic.FlowCenter.csproj", "Magic.FlowCenter/"]
RUN dotnet restore "Magic.Web.Entry/Magic.Web.Entry.csproj"
COPY . .
WORKDIR "/src/Magic.Web.Entry"
RUN dotnet build "Magic.Web.Entry.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Magic.Web.Entry.csproj" -c Release -o /app/publish

FROM base AS final
#拷贝字体
#COPY /wwwroot/Captcha/Font/zkkht.ttf /usr/share/fonts/zkkht.ttf
#安装libgdiplus 
#RUN apt-get update -y && apt-get install -y libgdiplus && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Magic.Web.Entry.dll"]